package com.woniuxy.oa.service.impl;

import com.woniuxy.oa.dao.PermissionDAO;
import com.woniuxy.oa.entity.Permission;
import com.woniuxy.oa.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @description:
 * @author: guohao
 * @time: 2019/12/25 11:05
 */
@Service
@Transactional
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDAO permissionDAO;

    @Override
    public List<Permission> getPermissions() {
        return permissionDAO.getPermissions();
    }

    @Override
    public List<Permission> getPermisstionByRoleOfUser(String empId) {
        return permissionDAO.getPermisstionByRoleOfUser(empId);
    }

    @Override
    public List<Permission> getPermisstionByUser(String empId) {

        return permissionDAO.getPermisstionByUser(empId);
    }

    @Override
    public List<Permission> getPermissionById(int deptId) {
        return permissionDAO.getPermissionById(deptId);
    }
}
